import Main from '@/view/main'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

export default [{
        path: '/login',
        name: 'login',
        meta: {
            title: 'Login - 登录',
            hideInMenu: true
        },
        component: () =>
            import (/* webpackChunkName: "loginView" */ '@/view/login/login.vue')
    },
    {
        path: '/',
        name: 'home',
        redirect: '/home',
        component: Main,
        meta: {
            hideInMenu: true,
            notCache: true
        },
        children: [{
            path: 'home',
            name: 'home',
            meta: {
                hideInMenu: true,
                notCache: true
            },
            component: () =>
                import ('@/view/single-page/home')
        }]
    },
    {
        path: '/sys',
        name: 'sys',
        meta: {
            icon: 'md-construct',
            title: '系统设置'
        },
        component: Main,
        children: [
          {
                path: 'client',
                name: 'client',
                meta: {
                    icon: 'md-apps',
                    title: '应用管理',
                    storeModules: ['clientStore']
                },
                component: () =>
                    import (/* webpackChunkName: "clientView" */ '@/view/client/clientManage')
            },
            {
              path: 'manage',
              name: 'manage',
              meta: {
                  icon: 'md-people',
                  title: '用户管理',
                  storeModules: ['userStore','userRoleStore']
              },
              component: () =>
                  import (/* webpackChunkName: "userView" */ '@/view/user/UserManage')
          },
            {
                path: 'role',
                name: 'role',
                meta: {
                    icon: 'md-contacts',
                    title: '用户角色',
                    storeModules: ['userRoleStore','resourceStore', 'clientStore']
                },
                component: () =>
                    import (/* webpackChunkName: "userRoleView" */ '@/view/user/UserRole')
            },
            {
                path: 'resource',
                name: 'resource',
                meta: {
                    icon: 'md-restaurant',
                    title: '应用资源',
                    storeModules: ['resourceStore', 'clientStore']
                },
                component: () =>
                    import (/* webpackChunkName: "resourceView" */ '@/view/client/resourceManage')
            }
        ]
    },
    {
        path: '/job',
        name: 'job',
        meta: {
            icon: 'md-alarm',
            title: '任务管理'
        },
        component: Main,
        children: [
            {
                path: 'list',
                name: 'jobList',
                meta: {
                    icon: 'md-apps',
                    title: '计划任务',
                    storeModules: ['jobStore']
                },
                component: () =>
                    import (/* webpackChunkName: "jobView" */ '@/view/job/jobView')
            },
            {
                path: 'scheduler',
                name: 'jobScheduler',
                meta: {
                    icon: 'md-apps',
                    title: '调度器实例',
                    storeModules: ['schedulerStore']
                },
                component: () =>
                    import (/* webpackChunkName: "schedulerView" */ '@/view/job/schedulerView')
            }
        ]
    },
    {
        path: '/401',
        name: 'error_401',
        meta: {
            hideInMenu: true
        },
        component: () =>
            import (/* webpackChunkName: "401View" */ '@/view/error-page/401.vue')
    },
    {
        path: '/500',
        name: 'error_500',
        meta: {
            hideInMenu: true
        },
        component: () =>
            import (/* webpackChunkName: "500View" */ '@/view/error-page/500.vue')
    },
    {
        path: '*',
        name: 'error_404',
        meta: {
            hideInMenu: true
        },
        component: () =>
            import (/* webpackChunkName: "404View" */ '@/view/error-page/404.vue')
    }
]
